package com.yixun.qfbao.xf.service;

import com.yixun.common.page.Page;
import com.yixun.qfbao.model.PartnerInfo;
import com.yixun.qfbao.model.ReportInfo;
import com.yixun.qfbao.util.exception.TServerException;
import com.yixun.qfbao.xf.model.Premises;
import com.yixun.qfbao.xf.model.dto.*;

import java.util.List;
import java.util.Map;

public interface PremisesService {

	Page<Premises> getPageModel(PremisesDto entity, int begin, int end);

	Page<Premises> getPageModelByArea(PremisesDto entity, int begin, int end);

	Page<PremisesDto> getPageModelByAcreage(PremisesDto entity, int begin, int end);

	Page<PremisesDto> getPremisesIncludeAttetion(PremisesDto entity, int begin, int end);
	
	Page<PremisesDto> getPageModelForHistory(PremisesDto entity, int begin, int end);

	List<Premises> getListModelByAcreage(PremisesDto entity);

	List<Premises> selectListByDto(PremisesDto entity);

	List<Premises> selectListByDto2(PremisesDto entity);

	List<Premises> selectSimpleListByDto(PremisesDto entity);

	List<Premises> selectMyListByDto(PremisesDto entity);

	List<Premises> selectLpInfo(PremisesDto entity);

	Premises selectByDto(PremisesDto entity);

	Premises selectById(Long id);

	Premises selectSimpleById(Long id);

	Premises selectBy(Premises entity);

	PremisesDto create(PremisesDto entity);

	int update(PremisesDto entity);

	int updateByPrimaryKey(PremisesDto entity);

	int delete(PremisesDto entity);

	int destroy(PremisesDto entity);

	int saveOrUpdate(PremisesDto entity);

	List<Premises> findList(PremisesDto entity);

	List<ZPremisesDto> selectPremisesCityListByDto(PremisesDto entity);

	Page<Premises> findPremisesByPartnerModel(PremisesDto entity, int begin, int end);

	List<Premises> listByName(PremisesDto entity);

	List<Premises> selectPremisesList(PremisesDto entity);

	Premises selectById2(Long premisesId);

	Map<String, Object> getPremisesList(PremisesDto premisesDto) throws TServerException;

	Page<PremisesDto> selectPremisesPageListWithRule(PremisesDto premisesDto, int begin, int end,String accountType,Long caseMembrId)
			throws TServerException;

	List<Premises> getListForCommissionRule(Long companyId,String accountType,Long partnerId);

	int audit(PremisesDto entity);

	int changeShelvesStatus(PremisesDto entity);

	Page<PremisesDto> getOutsidePremisesPage(PremisesDto premisesDto, int begin, int end);

	List<CityGroupDto> getPremisesCityList(String currentCity);

	List<CityGroupDto> getPremisesCityGroupByPinyin(String currentCity, PremisesDto premisesDto);
	
	Page<PremisesViewDto> getPremisesViewList(PremisesExtDto query);

    List<Premises> selectIdListByDto(PremisesDto entity);

	List<Premises> getListByCaseMember(PremisesDto entity);

	int updateMainPushPremises(PremisesDto entity);

    List<Premises> selectListForCaseMember(PremisesDto entity);

    List<Premises> selectIdListByMobileTemp(PremisesDto premisesDto);

	Premises getLastPremises(Long devCompanyId,Long agentCompanyId);

    Premises getSimpleById(Long aLong);

    int updatePremisesForRepeatReport(List<Long> premisesIdList);

    int updatePremisesForNoRepeatReport(PremisesDto premisesDto);

	int updatePremisesForCheckSwitch(List<Long> premisesIdList);

	int updatePremisesForNoCheckSwitch(PremisesDto premisesDto);

	int updatePremisesForFreeAudit(List<Long> premisesIdList);

	int updatePremisesForNoFreeAudit(PremisesDto premisesDto);

    Page<ReportInfo> getAgentPremisesList(PremisesDto entity, int begin, int pageSize);

	Boolean checkBindPremises(Long premisesId, PartnerInfo partnerInfo);
	
	void checkBindPremises(List<Long> premisesIds, PartnerInfo partnerInfo, List<Long> bindPremisesIds, List<Long> notBindPremiseIds);

	boolean checkMobileByPremises (String mobile, Long premisesId);
	
	String convertMobileByPremises(String mobile, Long premimsesId);
	
	String getReportWay(Long premisesId);

	/**
	 * 定时推送 楼盘信息查询
	 * @param lastTime
	 * @param companyId
	 * @return
	 */
	List<SendPremisesResultDto> getSendPremisesList(String lastTime, Long companyId);
}
